// pages/my/my.js
var util = require('../../../utils/util.js')
Page({
  data: {
    sex:[
      {value:1,name:'男'},
      {value:2,name:'女'}
    ],
    date:'',
  },
  onLoad: function (options) { 
    var date= util.formatDate(new Date())
    this.setData({
      date:date
    })
  },
  onReady: function () { },
  onShow: function () { },
  onHide: function () { },
  onUnload: function () { },
  onShareAppMessage: function () {},

  radioChange(e) {
    console.log('radio发生change事件，携带value值为：', e.detail.value)
    const sex = this.data.sex
    for (let i = 0, len = sex.length; i < len; ++i) {
      sex[i].checked = sex[i].value === e.detail.value
    }
    this.setData({
      sex
    })
  },
  bindDateChange: function(e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      date: e.detail.value
    })
  },
  goto:function(){
    wx.navigateTo({
      url: 'url',
    })
  }
})